{% if repo.recipe == 'docker-hosted' %}
{
    "action": "coreui_Repository",
    "method": "{{ action }}",
    "data": [{
        "attributes": {
            "docker": {
                {% if repo.httpPort is defined %}"httpPort": {{ repo.httpPort }},{% endif %}
                "forceBasicAuth": false,
                "v1Enabled": false
            },
            "storage": {
                "blobStoreName": "default",
                "strictContentTypeValidation": true,
                "writePolicy": "ALLOW"
            },
            "cleanup": {
                "policyName": ["{% if not repo.cleanup | default(false) %}None{% else %}blobs-cleanup{% endif %}"]
            }
        },
        "name": "{{ repo.name }}",
        "format": "",
        "type": "",
        "url": "",
        "online": true,
        "undefined": [true, false],
        "recipe": "docker-hosted"
    }],
    "type": "rpc",
    "tid": {{ repo_tid }}
}
{% elif repo.recipe == 'docker-proxy' %}
{
    "action": "coreui_Repository",
    "method": "{{ action }}",
    "data": [{
        "attributes": {
            "docker": {
                "forceBasicAuth": false,
                "v1Enabled": false
            },
            "proxy": {
                "remoteUrl": "{{ repo.url }}",
                "contentMaxAge": 1440,
                "metadataMaxAge": 1440
            },
            "dockerProxy": {
                "indexType": "REGISTRY"
            },
            "httpclient": {
                "blocked": false,
                "autoBlock": true,
                "connection": {
                    "useTrustStore": false
                }
            },
            "storage": {
                "blobStoreName": "default",
                "strictContentTypeValidation": true
            },
            "routingRules": {
                "routingRuleId": null
            },
            "negativeCache": {
                "enabled": true,
                "timeToLive": 1440
            },
            "cleanup": {
                "policyName": ["{% if not nexus_repo_cleanup_enabled | default(false) %}None{% else %}blobs-cleanup{% endif %}"]
            }
        },
        "name": "{{ repo.name }}",
        "format": "",
        "type": "",
        "url": "",
        "online": true,
        "undefined": [false, false],
        "authEnabled": false,
        "httpRequestSettings": false,
        "recipe": "docker-proxy"
    }],
    "type": "rpc",
    "tid": {{ repo_tid }}
}
{% endif %}
